package com.han.verifycode.data;

import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.han.verifycode.data.area.CircleArea;
import com.han.verifycode.data.area.RectangleArea;

/**
 * 范围
 */

@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonSubTypes({
        @JsonSubTypes.Type(value = RectangleArea.class, name = "Rectangle"),
        @JsonSubTypes.Type(value = CircleArea.class, name = "Circle")
})
public abstract class Area {
    /**
     * 判断点是否在范围内
     *
     * @return
     */
   public abstract boolean verifyPosition(Position position);

}
